﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="user.aspx.cs" Inherits="user" %>

<%@ Register Src="head.ascx" TagName="Head" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>小工具</title>
     <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
 <div style="vertical-align: middle; text-align: center">
    <form id="form1" runat="server">
    <div>
    <table width="100%" border="0">
        <tr>
       <td style="height: 53px">
        <uc1:Head ID="Head2" runat="server" />
    </td>
       </tr>
  <tr>
    <td style="font-size: 15px; font-family: 宋体">
        <br />
        管理员列表<br />
        &nbsp;<asp:GridView PagerSettings-Mode="Numeric" ID="GridView1" runat="server" AllowPaging="True"  OnPageIndexChanging="GridView1_PageIndexChanging" AutoGenerateColumns="False" OnRowEditing="GridView1_RowEditing" Width="964px" OnRowDeleting="GridView1_RowDeleting" >
            <Columns>
                <asp:BoundField DataField="user_id" HeaderText="ID" />
                <asp:BoundField DataField="user_name" HeaderText="用户名" />
                <asp:BoundField DataField="password" HeaderText="密码" />
                <asp:TemplateField HeaderText="状态">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                       <%# DGFormatSex(Convert.ToString(DataBinder.Eval(Container.DataItem,"status"))) %>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="email" HeaderText="email" />
                <asp:BoundField DataField="mobile" HeaderText="手机" />
                <asp:BoundField DataField="qq" HeaderText="qq" />
                <asp:BoundField DataField="msn" HeaderText="msn" />
                <asp:BoundField DataField="ww" HeaderText="旺旺" />
                <asp:BoundField DataField="create_time" HeaderText="创建时间" />
                <asp:CommandField HeaderText="操作" ShowEditButton="True" EditText="修改" ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
        <br />
        <table id="tblLog" runat="server" border="1" cellpadding="0" cellspacing="0" width="500">
            <tr>
                <td colspan="2">
                    添加管理员 &nbsp;</td>
            </tr>
            <tr>
                <td>
                    姓名：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入用户名" ControlToValidate="txtName"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    密码：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="txtPassword" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请输入密码" ControlToValidate="txtPassword"></asp:RequiredFieldValidator></td>
            </tr>
            <tr>
                <td>
                    状态：</td>
                <td align="left">
                    &nbsp;<asp:DropDownList ID="ddlArea" runat="server" AutoPostBack="true">
                        <asp:ListItem Value="1">在用</asp:ListItem>
                        <asp:ListItem Value="0">停止</asp:ListItem>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td>
                    电子邮件：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox></td>
            </tr>
             <tr>
                <td>
                    手机号码：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="TxtMobile" runat="server"></asp:TextBox></td>
            </tr>
             <tr>
                <td>
                    QQ：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="TxtQQ" runat="server"></asp:TextBox></td>
            </tr>
             <tr>
                <td>
                    旺旺：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="TxtWW" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    MSN：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="TxtMSN" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
            <td>
                    SMS：</td>
                <td align="left">
                    &nbsp;<asp:TextBox ID="TxtSMS" runat="server"></asp:TextBox></td>
            </tr>
            <tr>
                <td>
                    备   注：</td>
                <td align="left">
                    &nbsp;<asp:TextBox runat="server" ID="memo" TextMode="MultiLine" Height="144px" Width="384px" ></asp:TextBox>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td align="left">
                    <% if (sign == 0)
                       { %>
                    <asp:Button ID="cmdAdd2" runat="server" Text="添加" OnClick="cmdAdd2_Click" />
                    <%}
                      else
                      { %>
                      <asp:Button ID="cmdAddupdate" runat="server" Text="修改" OnClick="cmdAddupdate_Click" />
                      <asp:HiddenField id="user_id" runat="server" />
                      <asp:HiddenField id="create_time" runat="server" />
                    <%} %>
                    </td>
            </tr>
        </table>
        <br />
        &nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
            ShowSummary="False" />
    </td>
  </tr>
</table>
    </div>
    </form>
    </div>
</body>
</html>
